package com.agricultural.emergency;

import com.agricultural.equipment.AgriculturalEquipment;

public class EmergencyHandlerChain implements EmergencyHandler {
    private EmergencyHandler head;

    public EmergencyHandlerChain() {
        // 构建责任链
        EmergencyHandler lowFuelHandler = new LowFuelHandler(null);
        head = new ObstacleHandler(lowFuelHandler);
    }

    @Override
    public void handleEmergency(AgriculturalEquipment equipment, String emergencyType) {
        head.handleEmergency(equipment, emergencyType);
    }
}    